package com.lmf.springboot.web;

import com.lmf.springboot.service.StudentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@Slf4j  //开启日志注解
public class StudentController {

    @Autowired
    private StudentService studentService;

    @RequestMapping("/student/count")
    @ResponseBody
    public String dosome(){
        //手动输出日志
        log.trace("学生总数：7");
        log.debug("学生总数：7");
        log.info("学生总数：7");
        log.warn("学生总数：7");
        log.error("学生总数：7");
        Integer num=studentService.queryStudentCount();
        return "学生人数："+num;
    }
}
